

package com.hazelcast.map.impl;

import com.hazelcast.internal.monitor.impl.LocalMapStatsImpl;

/**
 * Utility methods for {@link LocalMapStatsImpl}
 */
public final class LocalMapStatsUtil {

    private LocalMapStatsUtil() {

    }

    /**
     * Increments other operations count statistic in local map statistics.
     */
    public static void incrementOtherOperationsCount(MapService service, String mapName) {
        MapServiceContext mapServiceContext = service.getMapServiceContext();
        MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
        if (mapContainer.getMapConfig().isStatisticsEnabled()) {
            LocalMapStatsImpl localMapStats = mapServiceContext.getLocalMapStatsProvider().getLocalMapStatsImpl(mapName);
            localMapStats.incrementOtherOperations();
        }
    }
}
